{template 'common/header'}
<ul class="nav nav-tabs">
	<li ><a href="{php echo $this->createWebUrl('user_list');}">< &nbsp;返回</a></li>
	<li {if $op == ''}class="active"{/if}><a href="{$urlt}">客户催费管理</a></li>
	<li {if $op == 'add'}class="active"{/if}><a href="{$urlt}&op=add">添加催费信息</a></li>
</ul>
<style>
	#modeladd li,#modelal li{ padding-top:5px; padding-bottom:5px; list-style: none;}
	.t_input{ height:30px; border: 1px solid #cccc; line-height: 30px; border-radius: 5px;}
	.bati{ padding-top:10px;}
</style>
{if $op == 'add' || $op == 'edit'}
<script>
	function ckgpt(num){
		if(num==0){
			document.getElementById('show0').style.display="";
			document.getElementById('show1').style.display="none";
		}else{
			document.getElementById('show0').style.display="none";
			document.getElementById('show1').style.display="";
		}
	}
</script>
<div class="main">
	
	<form name="formpt" action="{$urlt}" method="post" class="form-horizontal form" enctype="multipart/form-data" onsubmit='return formcheck()'>
	<input type="hidden" name="token" value="{$_W['token']}" />
    <input type="hidden" name="id" value="{$srdb['id']}" />
	<div class="panel panel-default">
		<div class="panel-heading">{if $op == 'add'}添加催费信息{elseif $op == 'edit'}修催费信息{/if}</div>
		<div class="panel-body">
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">催费名称</label>
				<div class="col-xs-12 col-sm-9" >
					<input class="form-control" name="titlename" id="" type="text" value="{$srdb['titlename']}" >
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-2 control-label">催费类型</label>
				<div class="col-sm-10">
				  <p class="form-control-static">
					<input type="radio" name="type" value="0" onclick="ckgpt(0)" {if $srdb['type']==0}checked{/if} />&nbsp;其他 &nbsp; &nbsp;&nbsp; &nbsp;
					<input type="radio" name="type" value="1" onclick="ckgpt(1)" {if $srdb['type']==1}checked{/if}/>&nbsp;默认服务费用
				  </p>
				</div>
			</div>
			
			<div id="show0" class="form-group" {if $srdb['type']==1}style="display:none;"{/if}>
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">催费金额</label>
				<div class="col-xs-12 col-sm-9" >
					<input class="form-control" name="paymoney" id="" type="text" value="{$srdb['paymoney']}" onkeyup="value=value.replace(/[^\d.]/g,'')" style="width:100px; float:left;"><span class="bati">&nbsp;元</span>
				</div>
			</div>
			
			<div id="show1" class="form-group" {if $srdb['type']!=1}style="display:none;"{/if}>
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">催费金额</label>
				<div class="col-xs-12 col-sm-9" >
					{if $op == 'add'}
					<input class="form-control" name="paymoney2" id="" type="text" {if $usershow2['payfees']>0}value="{$usershow2['payfees']}"{else}value="{$mb_config['month_money']}"{/if} onkeyup="value=value.replace(/[^\d.]/g,'')" style="width:100px; float:left;"><span class="bati">&nbsp;元</span>
					{elseif $op == 'edit'}
					<input class="form-control" name="paymoney2" id="" type="text" value="{$srdb['paymoney']}" onkeyup="value=value.replace(/[^\d.]/g,'')" style="width:100px; float:left;"><span class="bati">&nbsp;元</span>
					{/if}
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-xs-12 col-sm-3 col-md-2 control-label">催费说明</label>
				<div class="col-xs-12 col-sm-9" >
					<textarea style="height:100px;" class="form-control" name="message" cols="70" id="reply-add-text">{$srdb['message']}</textarea>
				</div>
			</div>
			
		</div>
	</div>
	<div class="form-group col-sm-12 col-xs-12">
		<input type="submit" name="{$op}_submit" value="提交" class="btn btn-primary col-lg-1" />
	</div>
  </form>
</div>

{else}

<div class='main'>
   	<div class="panel panel-info">
		<div class="panel-heading">所属</div>
		<div class="panel-body">
		  <div class="form-group">
			<label for="exampleInputName2">公司名称：</label>
			{$usershow2[compname]}
		  </div>
		</div>
	</div>
</div>

<script language="javascript" type="text/javascript">
	function checkAll(form, name) {
		for(var i = 0; i < form.elements.length; i++) {
			var e = form.elements[i];
			if(e.name.match(name)) {
				e.checked = form.elements['chkall'].checked;
			}
		}
	}
</script>
<div class="panel panel-default">
  <div class="panel-body">
    <form method="post" class="form">
	<input name="token" type="hidden" value="{$_W['token']}" />
	<div class="table-responsive">
	  <table class="table">
		<tr>
			<th width="50">选择</th>
			<th>催费项目</th>
			<th>催费类型</th>
			<th>催费金额</th>
			<th>发布时间</th>
			<th width="80">状态</th>
			<th width="150">操作</th>
		</tr>
		{loop $list $key $value}
		<tr >
			<td><input type="checkbox" name="ids[]" value="{$value[id]}"></td>
			<td>{$value['titlename']}</td>
			<td>{if $value['type']==1}默认服务费用{else}其他{/if}</td>
			<td><font color="#FF6600">￥{$value['paymoney']}</font></td>
			<td>{php echo date('Y-m-d H:i', $value['dateline']);}</td>
			<td>
				{if $value['status']==1}已支付
				{else}<font color="#CC0000">未支付</font>
				{/if}
			</td>
			<td>
				{if $value['status']==0}
				<a href="{$urlt}&op=edit&id={$value[id]}">查看</a> &nbsp;|&nbsp; 
				{/if}
				<a href="{$urlt}&op=delete&id={$value[id]}">删除</a>
			</td>
		</tr>
		{/loop}
		{if $pager}
		<tr >
			<td colspan="7">{$pager}</td>
		</tr>
		{/if}
		<tr >
			<td colspan="7" align="center">
				<input type="checkbox" id="chkall" name="chkall" onclick="checkAll(this.form, 'ids')">全选 &nbsp;&nbsp;
				<input type="radio" name="optype" value="1">删除
				<input type="submit" name="listsubmit" value="提交" class="btn btn-default">
			</td>
		 </tr>
	  </table>
	</div>
	</form>
  </div>
</div>
{/if}

{template 'common/footer'}